package com.woniu.service.impl;

import com.woniu.dao.UsersDao;
import com.woniu.domain.User;
import com.woniu.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UsersServiceImpl implements UsersService {
    @Autowired(required = false)
    UsersDao usersDao;
    @Override
    // //根据角色id查询角色集合
    public List<User> getByRoleId(Integer roleId) {
        return usersDao.getByRoleId(roleId);
    }

    @Override
    //根据姓名集合查询对应的角色信息
    public List<User> getUserByName(List<String> userName) {
        return usersDao.getUserByName(userName);
    }

    @Override
    //根据姓名集合修改对应的角色选课数量
    public int updateUserCourseNum(List<String> userName) {
        return usersDao.updateUserCourseNum(userName);
    }

    @Override
    public int updateUserNews(User user) {
        return usersDao.updateUserNews(user);
    }
}
